package com.hdaccp.cloud.controller;

import com.hdaccp.cloud.bean.Users;
import com.hdaccp.cloud.service.UsersServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UsersController {
    @Autowired
    private UsersServiceClient serviceClient;
    @RequestMapping("/feign/users/queyUsers")
    public List<Users> query(){
        return serviceClient.queyUsers();
    }

    @RequestMapping("/feign/users/getUsers/{id}")
    public Users getUsers(@PathVariable("id") int id){
        return serviceClient.getUsers(id);
    }
}
